fix: emit expression case values for IF flows#492
Conversation
4c3a2c0 to
557016e
Compare
Symptom: consistency validation can report duplicate output variables for values declared in mutually exclusive IF branches after exec builds the graph. A targeted Mendix 9 validation pass also showed that emitting ExpressionCase directly breaks legacy MPRs because that metamodel stores boolean branches as enumeration-style case values. Root cause: IF sequence flows used EnumerationCase values as the only in-memory representation. That conflates IF branch cases with real enum split cases, but the writer also needs to honor the target Mendix version when serializing the case object. Fix: represent true/false IF branch flows as ExpressionCase internally, keep EnumerationCase for real enum split values, serialize ExpressionCase as ExpressionCase for modern MPRs, and downgrade it to EnumerationCase when writing Mendix 9 projects. Tests: make build, make test, make lint-go.
557016e to
ee8d0a8
Compare
Review: fix: emit expression case values for IF flowsVerdict: Approve with minor notes What the PR doesFixes issue #491: mxcli was serializing IF-branch sequence flows as No blockersModerate concernNo DESCRIBE roundtrip test (Recurring Finding #4) The PR adds unit tests for Suggested: add a test in Minor issues
The updated Positive notes
|
PR #492 changed boolean IF-branch flows from EnumerationCase to ExpressionCase. The regression test was asserting on the old type directly; switch to flowCaseString() to handle all CaseValue variants uniformly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #491.
Summary
Validation